1. Field of the Invention
The present invention relates to a technique for compressing an image on a predetermined block basis, and a technique for performing image processing and decompression processing for an image compressed on a block basis.
2. Description of the Related Art
There have been great demands for high-resolution color images. In order to meet such requests for the improvement in image quality, digital multifunction peripherals increasingly handle images with 1200 dpi or higher resolutions. With the increase in image resolution, the number of pixels that need to be subjected to image processing is dramatically growing, causing concern of increased load involved in the image processing. For example, doubling the resolution from 600 dpi to 1200 dpi results in quadrupling the number of pixels to be processed. In such digital multifunction peripherals, as well as in image processing apparatuses such as digital cameras and facsimile apparatuses, color image data is compressed in order to save the capacities of memory and a hard disk and to reduce the write time for the memory and the hard disk, thereby realizing cost reduction and speedup.
Compression of color still images often employs JPEG schemes using discrete cosine transform, and schemes using wavelet transform. Generally, these types of coding schemes achieve high compression efficiency by encoding an image on a predetermined block basis (for example, on an 8×8 or 16×16 pixel basis) and performing discrete cosine transform, quantization, and entropy coding. Since these types of coding schemes are variable-length coding schemes, the amount of code varies among encoded images.
With the above image compression, referring to and converting pixel data of compressed data requires decoding the compressed data. That is, image processing cannot be performed for the compressed data as it is, but necessitates decoding processing. Then, all pixels of the high-resolution data need to be processed on a pixel basis. This leads to increased processing time.
As techniques for performing compression processing without encoding pixel data, the following techniques have been disclosed: the known run-length compression scheme, in which pixel data and the number of sequences of the pixel data are stored; and a technique in which compression is performed by detecting an edge on a block basis and storing two colors involved in the edge (for example, Japanese Patent Laid-Open No. 2008-271046).
In the above Japanese Patent Laid-Open No. 2008-271046, the inside of a block is divided into two colors to store shape information on the arrangement of the two colors and color information on the two colors.
For further improvement of image quality and speedup of processing, the applicant has made the following proposal in Japanese Patent Application No. 2009-221444. In this technique, image data is divided into blocks of a size of 2×2 pixels each to compare color data of each pixel in each block. Then, arrangement pattern information on the color data contained in a focus block, and color data information on each color contained in the focus block are output. The output color data information is separated into first color data information corresponding to a pixel at a predetermined position in the block, and other color data information (second to fourth color data information), which are collectively stored in respective memory areas along with the arrangement pattern information. Thus, degradation of the image quality of blocks containing more than two colors is avoided to achieve improved image quality. Also, the thinned-out image data at the specific position is placed as the first color data information in consecutive memory areas, so that a low-resolution image can be handled without decoding. This enables the speedup of processing.
In the above technique, however, the arrangement pattern information, the first color data information, and the other color data information (the second to fourth color data information) are held for each focus block. Accordingly, treating a number of focus blocks as a unit may cause redundancy in the color data.